﻿using Microsoft.Extensions.Configuration;

namespace SageKing.OpenIddict.UI.Identity.Api.Features;

public class OpenIddictUIApiFeature : FeatureBase
{
    public OpenIddictUIApiFeature(IModule module) : base(module)
    {
    }

    /// <summary>
    /// Represents the options for feature.
    /// </summary> 
    public Action<OpenIddictUIIdentityApiOptions> uiApiOptions { get; set; } = _ => { };

    /// <inheritdoc />
    public override void Apply(IConfigurationManager configurationManager, IHostEnvironment hostEnvironment)
    {
        ArgumentNullException.ThrowIfNull(configurationManager);
        Services.Configure(uiApiOptions); 
    }
}
